#pragma once
#include <vector>
#include <iostream>
#include <string>
#include <sw/redis++/redis++.h>
template <class T>
void PrintContainer(const T &container)
{
    for (auto &elem : container)
    {
        std::cout << elem << std::endl;
    }
}

template <>
void PrintContainer<std::vector<sw::redis::OptionalString>>(const std::vector<sw::redis::OptionalString> &container)
{
    for (auto &elem : container)
    {
        if (elem)
        {
            std::cout << elem.value() << std::endl;
        }
        else
        {
            std::cout << "元素不存在" << std::endl;
        }
    }
}

template <>
void PrintContainer<std::vector<std::pair<std::string, double>>>(const std::vector<std::pair<std::string, double>> &container)
{
    for (auto &elem : container)
    {
        std::cout << "key:" << elem.first << "value:" << elem.second << std::endl;
    }
}
// template <class T>
// void PrintContainerPair(const T &container)
// {
//     for (auto &elem : container)
//     {
//         std::cout << elem.first << elem.second << std::endl;
//     }
// }